.TH "RIFFFile" 3 "13 Oct 2009" "Version 2" "zebulon" \" -*- nroff -*-
.ad l
.nh
.SH NAME
RIFFFile \- 
.SH SYNOPSIS
.br
.PP
.PP
Inherited by \fBAVIFile\fP.
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBRIFFFile\fP ()"
.br
.ti -1c
.RI "\fBRIFFFile\fP (const \fBRIFFFile\fP &)"
.br
.ti -1c
.RI "virtual \fB~RIFFFile\fP ()"
.br
.ti -1c
.RI "\fBRIFFFile\fP & \fBoperator=\fP (const \fBRIFFFile\fP &)"
.br
.ti -1c
.RI "virtual bool \fBOpen\fP (const char *s)"
.br
.ti -1c
.RI "virtual bool \fBCreate\fP (const char *s)"
.br
.ti -1c
.RI "virtual void \fBClose\fP ()"
.br
.ti -1c
.RI "virtual int \fBAddDirectoryEntry\fP (FOURCC type, FOURCC name, off_t length, int list)"
.br
.ti -1c
.RI "virtual void \fBSetDirectoryEntry\fP (int i, FOURCC type, FOURCC name, off_t length, off_t offset, int list)"
.br
.ti -1c
.RI "virtual void \fBSetDirectoryEntry\fP (int i, \fBRIFFDirEntry\fP &entry)"
.br
.ti -1c
.RI "virtual void \fBGetDirectoryEntry\fP (int i, FOURCC &type, FOURCC &name, off_t &length, off_t &offset, int &list) const "
.br
.ti -1c
.RI "virtual \fBRIFFDirEntry\fP \fBGetDirectoryEntry\fP (int i) const "
.br
.ti -1c
.RI "virtual off_t \fBGetFileSize\fP (void) const "
.br
.ti -1c
.RI "virtual void \fBPrintDirectoryEntry\fP (int i) const "
.br
.ti -1c
.RI "virtual void \fBPrintDirectoryEntryData\fP (const \fBRIFFDirEntry\fP &entry) const "
.br
.ti -1c
.RI "virtual void \fBPrintDirectory\fP (void) const "
.br
.ti -1c
.RI "virtual int \fBFindDirectoryEntry\fP (FOURCC type, int n=0) const "
.br
.ti -1c
.RI "virtual void \fBParseChunk\fP (int parent)"
.br
.ti -1c
.RI "virtual void \fBParseList\fP (int parent)"
.br
.ti -1c
.RI "virtual void \fBParseRIFF\fP (void)"
.br
.ti -1c
.RI "virtual void \fBReadChunk\fP (int chunk_index, void *data)"
.br
.ti -1c
.RI "virtual void \fBWriteChunk\fP (int chunk_index, const void *data)"
.br
.ti -1c
.RI "virtual void \fBWriteRIFF\fP (void)"
.br
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "int \fBfd\fP"
.br
.in -1c
.SH "Constructor & Destructor Documentation"
.PP 
.SS "RIFFFile::RIFFFile ()"Creates the object without an output file. 
.SS "RIFFFile::~RIFFFile ()\fC [virtual]\fP"Destroys the object.
.PP
If it has an associated opened file, close it. 
.SH "Member Function Documentation"
.PP 
.SS "int RIFFFile::AddDirectoryEntry (FOURCC type, FOURCC name, off_t length, int list)\fC [virtual]\fP"Adds an entry to the list of containers.
.PP
\fBParameters:\fP
.RS 4
\fItype\fP the type of this entry 
.br
\fIname\fP the name 
.br
\fIlength\fP the length of the data in the container 
.br
\fIlist\fP the container in which this object is contained. 
.RE
.PP
\fBReturns:\fP
.RS 4
the ID of the newly created entry
.RE
.PP
The topmost object is not contained in any other container. Use the special ID RIFF_NO_PARENT to create the topmost object. 
.SS "void RIFFFile::Close (void)\fC [virtual]\fP"Destroys the object.
.PP
If it has an associated opened file, close it. 
.SS "bool RIFFFile::Create (const char * s)\fC [virtual]\fP"Creates or truncates the file.
.PP
\fBParameters:\fP
.RS 4
\fIs\fP the filename 
.RE
.PP

.SS "int RIFFFile::FindDirectoryEntry (FOURCC type, int n = \fC0\fP) const\fC [virtual]\fP"finds the index
.PP
finds the index of a given directory entry type
.PP
\fBTodo\fP
.RS 4
inefficient if the directory has lots of items 
.RE
.PP
\fBParameters:\fP
.RS 4
\fItype\fP the type of the entry to find 
.br
\fIn\fP the zero-based instance of type to locate 
.RE
.PP
\fBReturns:\fP
.RS 4
the index of the found object in the directory, or -1 if not found 
.RE
.PP

.SS "\fBRIFFDirEntry\fP RIFFFile::GetDirectoryEntry (int i) const\fC [virtual]\fP"Retrieves an entry.
.PP
Gets the whole \fBRIFFDirEntry\fP object.
.PP
\fBParameters:\fP
.RS 4
\fIi\fP the ID of the entry to retrieve 
.RE
.PP
\fBReturns:\fP
.RS 4
the entry 
.RE
.PP

.SS "void RIFFFile::GetDirectoryEntry (int i, FOURCC & type, FOURCC & name, off_t & length, off_t & offset, int & list) const\fC [virtual]\fP"Retrieves an entry.
.PP
Gets the most important member variables.
.PP
\fBParameters:\fP
.RS 4
\fIi\fP the ID of the entry to retrieve 
.br
\fItype\fP 
.br
\fIname\fP 
.br
\fIlength\fP 
.br
\fIoffset\fP 
.br
\fIlist\fP 
.RE
.PP

.SS "off_t RIFFFile::GetFileSize (void) const\fC [virtual]\fP"Calculates the total size of the file
.PP
\fBReturns:\fP
.RS 4
the size the file in bytes 
.RE
.PP

.SS "bool RIFFFile::Open (const char * s)\fC [virtual]\fP"Opens the file read only.
.PP
\fBParameters:\fP
.RS 4
\fIs\fP the filename 
.RE
.PP

.SS "void RIFFFile::ParseChunk (int parent)\fC [virtual]\fP"Reads all items that are contained in one list
.PP
Read in one chunk and add it to the directory. If the chunk happens to be of type LIST, then call ParseList recursively for it.
.PP
\fBParameters:\fP
.RS 4
\fIparent\fP The id of the item to process 
.RE
.PP

.SS "void RIFFFile::ParseList (int parent)\fC [virtual]\fP"Reads all items that are contained in one list
.PP
\fBParameters:\fP
.RS 4
\fIparent\fP The id of the list to process 
.RE
.PP

.PP
Reimplemented in \fBAVIFile\fP.
.SS "void RIFFFile::ParseRIFF (void)\fC [virtual]\fP"Reads the directory structure of the whole RIFF file 
.PP
Reimplemented in \fBAVIFile\fP.
.SS "void RIFFFile::PrintDirectory (void) const\fC [virtual]\fP"prints the contents of the whole directory
.PP
Prints a readable representation of the contents of an index. Override this to print out any objects you store in the RIFF file.
.PP
\fBParameters:\fP
.RS 4
\fIentry\fP the entry to print 
.RE
.PP

.SS "void RIFFFile::PrintDirectoryEntry (int i) const\fC [virtual]\fP"prints the attributes of the entry
.PP
\fBParameters:\fP
.RS 4
\fIi\fP the ID of the entry to print 
.RE
.PP

.SS "void RIFFFile::PrintDirectoryEntryData (const \fBRIFFDirEntry\fP & entry) const\fC [virtual]\fP"prints the contents of the entry
.PP
Prints a readable representation of the contents of an index. Override this to print out any objects you store in the RIFF file.
.PP
\fBParameters:\fP
.RS 4
\fIentry\fP the entry to print 
.RE
.PP

.SS "void RIFFFile::ReadChunk (int chunk_index, void * data)\fC [virtual]\fP"Reads one item including its contents from the RIFF file
.PP
\fBParameters:\fP
.RS 4
\fIchunk_index\fP The index of the item to write 
.br
\fIdata\fP A pointer to the data 
.RE
.PP

.SS "void RIFFFile::SetDirectoryEntry (int i, \fBRIFFDirEntry\fP & entry)\fC [virtual]\fP"Modifies an entry.
.PP
The entry.written flag is set to false because the contents has been modified
.PP
\fBParameters:\fP
.RS 4
\fIi\fP the ID of the entry which is to modify 
.br
\fIentry\fP the new entry 
.RE
.PP
\fBNote:\fP
.RS 4
Do not change length, offset, or the parent container. 
.PP
Do not change an empty name ('') to a name and vice versa 
.RE
.PP

.SS "void RIFFFile::SetDirectoryEntry (int i, FOURCC type, FOURCC name, off_t length, off_t offset, int list)\fC [virtual]\fP"Modifies an entry.
.PP
\fBParameters:\fP
.RS 4
\fIi\fP the ID of the entry which is to modify 
.br
\fItype\fP the type of this entry 
.br
\fIname\fP the name 
.br
\fIlength\fP the length of the data in the container 
.br
\fIlist\fP the container in which this object is contained. 
.RE
.PP
\fBNote:\fP
.RS 4
Do not change length, offset, or the parent container. 
.PP
Do not change an empty name ('') to a name and vice versa 
.RE
.PP

.SS "void RIFFFile::WriteChunk (int chunk_index, const void * data)\fC [virtual]\fP"Writes one item including its contents to the RIFF file
.PP
\fBParameters:\fP
.RS 4
\fIchunk_index\fP The index of the item to write 
.br
\fIdata\fP A pointer to the data 
.RE
.PP

.SS "void RIFFFile::WriteRIFF (void)\fC [virtual]\fP"Writes out the directory structure
.PP
For all items in the directory list that have not been written yet, it seeks to the file position where that item should be stored and writes the type and length field. If the item has a name, it will also write the name field.
.PP
\fBNote:\fP
.RS 4
It does not write the contents of any item. Use WriteChunk to do that. 
.RE
.PP

.PP
Reimplemented in \fBAVIFile\fP, \fBAVI1File\fP, and \fBAVI2File\fP.

.SH "Author"
.PP 
Generated automatically by Doxygen for zebulon from the source code.
